<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html>
<html>
    <head>
        <title>enterprise</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="../css/layout.css" />
        <link rel="stylesheet" type="text/css" href="../css/footer.css" />
        <script language="javascript"charset="UTF-8">
            //点击保存以后，向后台发送数据
            function createtable(){

            <s:iterator var="list" value="outputRecordList">
                    var plantime = '<s:property value="#list.planDate"/>';
                    var planamount = '<s:property value="#list.amount"/>';
                    var haspaid = '<s:property value="#list.hasPaid"/>';
                    var realdata = '<s:property value="#list.realDate"/>';
                    AddSignRow(plantime, planamount,
                    haspaid, realdata);
  
            </s:iterator>          
                }
                function send_table()
                {
                    var txtTRLastIndex = findObj("txtTRLastIndex",document);
                    var rowID = parseInt(txtTRLastIndex.value);
                    var all_data=new Array();
                    var all_td=new Array();
              
         
                    all_td=document.getElementById("SignFrame").getElementsByTagName("td");
                    for(var i=0;i<all_td.length;i++){
                        var list=all_td[i].getElementsByTagName("input");
                        for(var j=0;j<list.length;j++){
                            all_data.push(list[j].value);
                        }
                    }

                    document.form1.submit();
               
                };
            
                function findObj(theObj, theDoc){  
                    var p, i, foundObj;
                    if(!theDoc) theDoc = document;  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)  {    theDoc = parent.frames[theObj.substring(p+1)].document;    theObj = theObj.substring(0,p);  }  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];  for (i=0; !foundObj && i < theDoc.forms.length; i++)     foundObj = theDoc.forms[i][theObj];  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)     foundObj = findObj(theObj,theDoc.layers[i].document);  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);    return foundObj;}
                //添加一个参与人填写行
                function AddSignRow(time,money,bollean,time2){ //读取最后一行的行号，存放在txtTRLastIndex文本框中 

                    var txtTRLastIndex = findObj("txtTRLastIndex",document);
                    var rowID = parseInt(txtTRLastIndex.value);

                    var signFrame = findObj("SignFrame",document);
                    //添加行
                    var newTR = signFrame.insertRow(signFrame.rows.length);
                    newTR.id = "SignItem" + rowID;

                    //添加列:序号
                    var newTD=newTR.insertCell(0);
                    //添加列内容
                    newTD.innerHTML = newTR.rowIndex.toString();

             
                    var newNameTD=newTR.insertCell(1);
          
                    newNameTD.innerHTML = "<input name='inputRecordListDTO.planDate[" + rowID + "]' id='txtName" + rowID + "' type='text' size='12' value='"+time+"'/>";

                    
                    var newEmailTD=newTR.insertCell(2);
        
                  
                    newEmailTD.innerHTML = "<input name='inputRecordListDTO.planAmount[" + rowID + "]' id='txtEmail" + rowID + "' type='text' size='20' value='"+money+"'/>";
                    var newbolleanTD=newTR.insertCell(3);
                    var str='<s:property value="shi" />';
                    if(bollean==str){
                 
                        newbolleanTD.innerHTML = "<select name='inputRecordListDTO.isRepaid[" + rowID + "]'><option  selected='selected'>是</option><option>否</option></select>";
           
                    }else{
                        newbolleanTD.innerHTML = "<select name='inputRecordListDTO.isRepaid[" + rowID + "]'><option  selected='selected'>否</option><option>是</option></select>";
                    }
                    var newtimeTD=newTR.insertCell(4);
        
                    newtimeTD.innerHTML = "<input name='inputRecordListDTO.realDate[" + rowID + "]' id='txtEmail" + rowID + "' type='text' size='20' value='"+time2+"'/>";
        
                    var newDeleteTD=newTR.insertCell(5);
       
                    newDeleteTD.innerHTML = "<div align='center' style='width:40px'><a href='javascript:;' onclick=\"DeleteSignRow('SignItem" + rowID + "')\">删除</a></div>";

                    //将行号推进下一行
                    txtTRLastIndex.value = (rowID + 1).toString() ;
                }
                //删除指定行
                function DeleteSignRow(rowid){
                    var signFrame = findObj("SignFrame",document);
                    var signItem = findObj(rowid,document);

                    //获取将要删除的行的Index
                    var rowIndex = signItem.rowIndex;

                    //删除指定Index的行
                    signFrame.deleteRow(rowIndex);

                    //重新排列序号，如果没有序号，这一步省略
                    for(i=rowIndex;i<signFrame.rows.length;i++){
                        signFrame.rows[i].cells[0].innerHTML = i.toString();
                    }
                }//清空列表
                function ClearAllSign(){
                    if(confirm('确定要清空所有参与人吗？')){
                        var signFrame = findObj("SignFrame",document);
                        var rowscount = signFrame.rows.length;

                        //循环删除行,从最后一行往前删除
                        for(i=rowscount - 1;i > 0; i--){
                            signFrame.deleteRow(i);
                        }

                        //重置最后行号为1
                        var txtTRLastIndex = findObj("txtTRLastIndex",document);
                        txtTRLastIndex.value = "1";

                        //预添加一行
                        AddSignRow();
                    }
                }
           
        </script>
    </head>
    <body onload="javascript:createtable()">


        <div ID="container">
            <div ID="header">
                <div ID="logo">
                </div>
                <div class="nav"> </div>
                <div id="menu">
                    <ul>
                        <li><a href="#">首页</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">财务</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">社会环境</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">警告预警</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">客户</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">报表审核</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">设置</a>
                    </ul>	
                </div>	
            </div>
            <div class="nav"> </div>
            <div ID="main">
                <form name="form1"action="update_RepaymentRecrod" meathod="" id="form1">
                    <div>
                        <input type="hidden" name="enterprise.id" value="<s:property value="enterprise.id" />"/>
                    </div>    
                    <div id="up1">
                    </div>
                    <div id="middle1">
                        <div class="leftbox01">
                            <div class="left">
                            </div>

                        </div>
                        <div class="rightbox01">
                            <div class="buttombox01">
                                <div ID="logo01">
                                </div>

                                
                                <div style="float:left;margin-top: 40;">
                                    <table border="0" cellpadding="2" cellspacing="1" style="width:500px" id="my_table">
                                         <tr align="center">
                                            <td nowrap align="left" width="13%" class="nav03">企业等级：</td>
                                            <td  width="500px" >
                                                <s:property value="level"/>
                                            </td>
                                        </tr>
                                         <tr align="center">
                                            <td nowrap align="left" width="13%" class="nav03">社会环境总评：</td>
                                            <td  width="500px" >
                                                <s:property value="environmentTotal"/>
                                            </td>
                                        </tr>
                                         <tr align="center">
                                            <td nowrap align="left" width="13%" class="nav03">财务总评：</td>
                                            <td  width="500px" >
                                               <s:property value="financialTotal"/>
                                            </td>
                                        </tr>
                                        <tr align="center">
                                            <td nowrap align="left" width="13%" class="nav03">企业名称:</td>
                                            <td  width="500px" >
                                                <s:property value="enterprise.name"/>
                                            </td>
                                        </tr>
                                        <tr align="center">
                                            <td class="nav03" nowrap align="left" width="13%">企业地址:</td>
                                            <td  width="500px" >
                                                <s:property value="enterprise.address"/>
                                            </td>
                                        </tr>
                                        <tr align="center">
                                            <td  class="nav03"nowrap align="left" width="13%">企业类型:</td>
                                            <td  width="500px" >
                                                <s:property value="enterprise.enterpriseType.type"/>
                                            </td>
                                        </tr>
                                        <tr align="center">
                                            <td  class="nav03"nowrap align="left" width="13%">登陆账号：</td>
                                            <td  class="nav03"width="500px">
                                                <s:property value="enterprise.username"/>
                                            </td>
                                        </tr>
                                        <tr align="center">
                                            <td  class="nav03"nowrap align="left" width="13%">登陆密码:</td>
                                            <td  width="500px">
                                                <s:property value="enterprise.password"/>
                                            </td>
                                        </tr>
                                        <tr align="center">
                                            <td  class="nav03"nowrap align="left" width="13%">联系邮箱：</td>
                                            <td  width="500px">
                                                <s:property value="enterprise.email"/>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="buttombox02">
                            <div style="margin-top: 0; font-family:Arial, Helvetica, sans-serif;float:center;font-size: 26;">还贷计划</div>
                            <div style="margin-top: 5;margin-left: 180;float:left;clear:both">
                                <table Style="border: 0; width:100%" cellpadding="2"cellspacing="1">
                                    <tr>
                                        <td Style="float:right;width:100%;">
                                            <input type="button" name="Submit" value="添加计划" class="button" onclick="AddSignRow('','','','')"/>　
                                        </td>
                                    </tr>

                                </table>
                            </div>
                            <div style="margin-top: 0;margin-left:10 ;margin-bottom: 10;float:center;">
                                <div>
                                    <table width="727" border="1px #0066cc solid" cellpadding="2" cellspacing="1" id="SignFrame">
                                        <tr id="trHeader">
                                            <td width="27" >序号</td>
                                            <td width="150" >计划还贷时间</td>
                                            <td width="150" >计划还贷金额</td>
                                            <td width="150" >是否还贷</td>
                                            <td width="150" >实际还贷时间</td>
                                            <td wifth="100">删除</td>
                                        </tr>
                                    </table>
                                </div>
                                <div>
                                   
                                    <input name='txtTRLastIndex' type='hidden' id='txtTRLastIndex' value="1" />
                                </div>
                            </div>
                            <div style="margin-top:5; font-family:Arial, Helvetica, sans-serif;float:center;font-size: 13;">
                                <table Style="border: 0; width:100%" cellpadding="2"cellspacing="1">

                                    <tr>
                                        <td colspan="2" align="center" height="50px">
                                            <input type="button" name="Submit" value="保存" class="button" onclick="send_table();"/>　
                                        </td>
                                        <td colspan="2" align="center" height="50px">
                                            <input type="reset" name="Submit2" value="重置" class="button" /></td>
                                    </tr>
                                </table>
                            </div>
                        </div>

                    </div>
                    <div id="buttom1">
                    </div>
                </form>
            </div>
            <div ID="footer">
                <table id="footer-container" border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
                    <tbody>
                        <tr>
                            <td>
                                <table class="foot-links" border="0" cellpadding="0" cellspacing="0" width="100%">
                                    <tbody>
                                        <tr>
                                            <td><a href="http://www.citigroup.com/" target="_blank">Citigroup.com</a></td>
                                            <td><ul>
                                                    <li><a href="http://www.citi.com.cn/html/cn/about_us/citi_group.html">关于花旗</a></li>
                                                    <li><a href="http://www.citi.com.cn/html/cn/HR/HR.html" target="_blank">加入花旗</a></li>
                                                    <li><a href="https://www.citibank.com.cn/CNGCB/APPS/portal/loadPage.do?path=/info/det/atm_network.htm">分行位置</a></li>
                                                    <li><a href="http://www.citibank.com.cn/chinese/footer/sitemap.htm">网站导航</a></li>
                                                    <li><a href="http://www.citibank.com.cn/chinese/footer/privacy.htm">隐私保护</a></li>
                                                    <li><a href="http://www.citibank.com.cn/chinese/footer/terms.htm">条件与条款</a></li>
                                                </ul>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                    <tbody>
                                        <tr>
                                            <td class="footer-logo"><img src="../image/logo_footer.gif" alt="Citi" title="Citi"></td>
                                            <td class="foot-gray" align="right">沪ICP备05047918<br>
                                                Copyright ? 2011 Citigroup Inc.</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </body>
</html>